<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <body>
        <ui:composition template="./AdminTemplate.xhtml">
            <ui:define name="content">
                <div class="grid_2">
                    <div class="da-panel">
                        <div class="da-panel-header">
                            <span class="da-panel-title">
                                <img alt=""  src="images/icons/color/accept.png"/>
                                Add New Vehicle
                            </span>
                        </div>
                        <div class="da-panel-content">
                            <h:form styleClass="da-form">
                                <div style="display:none;" class="da-message error" id="da-ex-val1-error"></div>
                                <div class="da-form-inline">
                                    <div class="da-form-row">
                                        <label>Vehicle Name <span class="required">*</span></label>
                                        <div class="da-form-item large">
                                            <h:inputText styleClass="required" value="#{addVehicle.vehicles.vehilceName}" required="true" requiredMessage="Enter Vihilce Name"/>
                                        </div>
                                    </div>
                                    <div class="da-form-row">
                                        <label>Model Number <span class="required">*</span></label>
                                        <div class="da-form-item large">
                                            <h:inputText value="${addVehicle.vehicles.modulNumber}"/>
                                        </div>
                                    </div>
                                    <div class="da-form-row">
                                        <label>Type <span class="required">*</span></label>
                                        <div class="da-form-item large">
                                            <h:selectOneMenu value="#{addVehicle.vehicles.typeID}">
                                                <f:selectItems var="vh" value="#{addVehicle.lst}"  itemLabel="#{vh.typeName}" itemValue="#{vh.typeID}" />
                                            </h:selectOneMenu>
                                        </div>
                                    </div>
                                    <div class="da-form-row">
                                        <label>Price <span class="required">*</span></label>
                                        <div class="da-form-item large">
                                            <h:inputText value="#{addVehicle.vehicles.price}"/>
                                        </div>
                                    </div>
                                    <div class="da-form-row">
                                        <label>Cylinder <span class="required">*</span></label>
                                        <div class="da-form-item large">
                                            <h:inputText value="#{addVehicle.vehicles.cylinder}"/>
                                        </div>
                                    </div>
                                    <div class="da-form-row">
                                        <label>GearBox <span class="required">*</span></label>
                                        <div class="da-form-item large">
                                            <h:inputText value="#{addVehicle.vehicles.gearBox}"/>
                                        </div>
                                    </div>
                                    <div class="da-form-row">
                                        <label>Series <span class="required">*</span></label>
                                        <div class="da-form-item large">
                                            <h:inputText value="#{addVehicle.vehicles.series}"/>
                                        </div>
                                    </div>
                                    <div class="da-form-row">
                                        <label>Combustible <span class="required">*</span></label>
                                        <div class="da-form-item large">
                                            <h:inputText value="#{addVehicle.vehicles.combustible}"/>
                                        </div>
                                    </div>
                                    <div class="da-form-row">
                                        <label>Seat <span class="required">*</span></label>
                                        <div class="da-form-item large">
                                            <h:inputText value="#{addVehicle.vehicles.seat}"/>
                                        </div>
                                    </div>
                                    <div class="da-form-row">
                                        <label>Color <span class="required">*</span></label>
                                        <div class="da-form-item large">
                                            <h:inputText value="#{addVehicle.vehicles.color}"/>
                                        </div>
                                    </div>
                                    <div class="da-form-row">
                                        <label>Quantity <span class="required">*</span></label>
                                        <div class="da-form-item large">
                                            <h:inputText value="#{addVehicle.vehicles.quantity}"/>
                                        </div>
                                        <div class="da-button-row">
                                            <h:commandButton action="#{addVehicle.addCar}" value="Add New" styleClass="da-button red submit">
                                                <f:param name="vehicleID" value="#{addVehicle.vehicles.vehicleID}" />
                                            </h:commandButton>
                                        </div>
                                    </div>
                                </div>
                            </h:form>
                        </div>
                    </div>
                </div>
            </ui:define>
        </ui:composition>

    </body>
</html>
